<!DOCTYPE html>
<html>
<head>
  <title>News - SCMS</title>
  <link rel="stylesheet" type="text/css" href="lib/bootstrap/dist/css/bootstrap.css">
</head>
<body ng-app="webapp">
<div class="container" ng-controller="NewsController">
  <h2>News</h2>
  <button class="btn btn-primary" ng-click="createNews()">Create News</button>
  <div class="row" ng-repeat="news in list">
    <div class="col-sm-2">
      <small ng-bind="formatTime(news.createTime)"></small>
    </div>
    <div class="col-sm-10">
      <a href="javascript: void(0)" ng-click="openNewsDetail(news._id)">{{news.title}}</a>
    </div>
  </div>
  <div class="modal fade" id="modal-detail">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h1 ng-bind="current.title"></h1>
          <span ng-bind="formatTime(current.createTime)"></span>
        </div>
        <div class="modal-body">
          <div ng-bind="current.content"></div>
        </div>
      </div>
    </div>
  </div>
  <div class="modal fade" id="modal-editor">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h1>News Editor</h1>
        </div>
        <div class="modal-body">
          <div class="form-horizontal">
            <div class="form-group">
              <label class="col-sm-2 control-label">Title</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" ng-model="new.title" placeholder="News Title" />
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">Content</label>
              <div class="col-sm-10">
                <textarea class="form-control" ng-model="new.content" placeholder="News Content" cols=50 rows=10></textarea>
              </div>
            </div>
            <div class="form-group">
              <div class="col-sm-offset-2 col-sm-10">
                <button class="btn btn-primary" ng-click="save()">Save</button>
                <span class="help-inline text-danger" ng-bind="editorMessage"></span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

</div>
<script type="text/javascript" src="lib/angular/angular.js"></script>
<script type="text/javascript" src="lib/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="lib/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript" src="lib/moment/moment.js"></script>
<script type="text/javascript" src="webapp.js"></script>
<script type="text/javascript" src="services/news.client.service.js"></script>
<script type="text/javascript" src="controllers/news.client.controller.js"></script>
</body>
</html>